package com.xcjh.module_ws.websocket.bean

import java.io.Serializable

/**
 * 接收数据
 *
 * 基础响应体
 */
data class ReceiveWsBean<T>(
    val code: String,   // 10007  10008
    val command: Int,   // 6，对应的cmd：5
    val msg: String? = "",   // 消息内容
    val `data`: T? = null,   // 消息内容
): Serializable

/**
 * 群聊和私聊消息内容
 *
 *{"command":11,"data":{"anchorId":"1689193696521482240","chatType":2,"cmd":11,"content":"123","createTime":1692328015422,"from":"1692360254443462656","id":"1692372475416412160","msgType":0,"to":"1689193696521482240"}}
 */
data class ChatMsgBean(
    val id: String? = "",   // 消息ID
    val chatType: Int? = 1,   // 聊天类型，群聊：1， 私聊：2
    val msgType: Int? = 0, //消息类型，文字：0， 图片：1
    val cmd: Int? = null,   // 6，对应的cmd：5
    val content: String? = "",   // 消息内容
    val createTime: String? = "",   // 消息时间
    val from: String? = "",   // 发送者ID
    val groupId: String? = null,   // 群聊ID【群聊独有】
)

/**
 * 接收到已读消息成功
 * cmd 23
 */
data class ReceiveReadWsBean(
    val cmd: Int? = null,
    val messageId: String? = "",//messageId
    val read: Int? = 1,// 0-未读， 1-已读
    val currentId: String? = null,//当前用户ID
    val channelType: Int? = 3,//消息发送平台：2-LIVE, 3-APP
    val toId: String? = "3",//接收人ID
)